﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sport_Shop.DAL;

namespace WebApplication1
{
    public partial class SanPham : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                load_SPtheoLoai();
        }
        private void load_SPtheoLoai()
        {
            if (Request.QueryString["MaLoai"] == null)
            {
                Response.Redirect("~/Index.aspx");
            }
            else
            {
                DataAccess da = new DataAccess();
                string ML = Request.QueryString["MaLoai"].ToString();
                string sql = "SELECT HinhAnh, TenSP, DonGia FROM SanPham WHERE MaLoai = '" + ML + "'";
                dlSanphamOfLoai.DataSource = da.GetDataList(sql).Tables[0];
                dlSanphamOfLoai.DataBind();
            }

        }
    }
}